package com.springStudy.context;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.AnnotationConfigUtils;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AnnotationConfigApplicationContextDemo {

    public static void main(String[] args) {

        ApplicationContext context = new AnnotationConfigApplicationContext(AnnotationConfigApplicationContextDemo.class);
        String[] beanDefinitionNames = context.getBeanDefinitionNames();

        System.out.println("-------------- bean name ---------------");
        for (String beanName : beanDefinitionNames) {
            System.out.println(beanName + " : " + context.getBean(beanName));
        }
    }
}
